package liwen.zhao.controller;

import liwen.zhao.common.jd.pojo.Seckill;
import liwen.zhao.common.jd.vo.SysResult;
import liwen.zhao.service.SecKillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/seckill")
public class SecKillController {
    @Autowired
    private SecKillService secKillService;
    
    @RequestMapping(method = RequestMethod.POST)
    public SysResult add(Seckill seckill){
        return secKillService.addSecKill(seckill);
    }
    
    @RequestMapping(value = "/getThree", method = RequestMethod.GET)
    public SysResult getThree(){
        return secKillService.getThree();
    }
    @RequestMapping(value = "/doSeckill", method = RequestMethod.POST)
    public SysResult doSeckill(int uid,int sid){
        return secKillService.doSeckill(uid,sid);
    }
}
